<?php echo $this->Html->script(array('print')); ?>
<div id="areaImprimir">
<table class="wtbl_list">
    <thead>
        <tr>
            <th>Medicamento</th>
            <th>Cantidad</th>                                    
            <th>Dosis</th>
            <th>Seguros</th>
            <th>Observaciones</th>
            <th>Acciones</th>
        </tr>
    </thead>
    <tbody>                   
        <?php $i = 0; ?>

        <?php foreach ($datosMedicamentosPaciente as $dmp): ?>

            <tr class="<?php echo $estilo = fmod($i, 2) ? "tr_even" : "tr_odd"; ?>">

                <td><?php echo $dmp['Medicamento']['nombre']; ?></td>
                <td><?php echo $dmp['MedicamentosPaciente']['cantidad']; ?></td>
                <td><?php echo $dmp['MedicamentosPaciente']['dosis']; ?></td>
                <td><?php echo $dmp['MedicamentosPaciente']['seguro']; ?></td>
                <td><?php echo $dmp['MedicamentosPaciente']['observaciones']; ?></td>
                <td>
                    <?php echo $this->Html->link($this->Html->image("iconos/elim.png", array("alt"=>'delete', 'title'=>'ELIMINAR RECETA')), array('action'=>'eliminareceta',$idPaciente, $idConsultaExterna,$dmp['MedicamentosPaciente']['id']), array('escape'=>false),'esta seguro de eliminar '.$dmp['MedicamentosPaciente']['nombre']);?>
                </td>                                                                                                   

            </tr>	
            <?php $i++; ?>
        <?php endforeach; ?>
    </tbody>
</table>
</div>



<script>
        $(document).ready(function() {
            $("#vertical").hide();

        $("#btnVertical").click(function() {
            $("#vertical").toggle('slow');
        });
        $("#btnImprimir").click(function() {
            console.log('<?php echo $this->webroot ?>');
            //printElem({leaveOpen: true, printMode: 'popup'});
            printElem({overrideElementCSS: ["<?php echo $this->webroot ?>/css/imprimetabla.css"]});
        });

    });
    function printElem(options) {
        $('#areaImprimir').printElement(options);
    }
</script>